import request from '@/utils/request'

// 获取通知任务分页
export function requestInfoNoticePage(data) {
  return request({
    url: '/noticeSendConfig/page',
    method: 'post',
    data: data,
  })
}
// 新增通知任务
export function requestInfoNoticeAdd(data) {
  return request({
    url: '/noticeSendConfig/create',
    method: 'post',
    data: data,
  })
}
// 编辑通知任务
export function requestInfoNoticeEdit(data) {
  return request({
    url: '/noticeSendConfig/update',
    method: 'post',
    data: data,
  })
}
// 获取通知任务详情
export function requesInfoNoticeDetail(params) {
  return request({
    url: `/noticeSendConfig/id/${params.id}`,
    method: 'get',
  })
}
// 删除通知任务
export function requesInfoNoticeDelete(params) {
  return request({
    url: `/noticeSendConfig/delete/${params.id}`,
    method: 'post',
  })
}
// 发送消息测试
export function sendTestMessage(data) {
  return request({
    url: `/noticeSend/sendTestMessage`,
    method: 'post',
    data: data,
  })
}

//批量删除
export function requestInfoNoticeBatchDelete(list) {
  return request({
    url: '/noticeSendConfig/deleteBatch',
    method: 'post',
    data: {
      idList: list.map((item) => item.id),
    },
  })
}
